<?php
error_reporting(E_ALL | E_NOTICE);
include ("config.inc.php");

	$description       = escape('description');
	$page              = escape('page');
	$priority          = escape('priority');
	$title             = escape('title');
	$c_id              = escape('c_id');
	$p_id              = escape('project');
	$deadline          = escape('deadline');
	
    $add_update  = "INSERT INTO updates (description,page,priority,date_submitted,title,deadline,p_id) VALUES ('$description','$page','$priority',NOW(),'$title','$deadline','$p_id')";
    mysql_query($add_update) or die(mysql_error());
	
	$to      = "Ryan Gatto <ryangatto@catonthecouchproductions.com>, Ryan Coughlin <glanceatx@gmail.com>";
	$subject = "COTC Intranet: $title";
	$message = "Hello! This is a simple email message.";
	$from    = "clientmail@cotcintranet.com";
	
	$headers  = 'To: Ryan Gatto <ryangatto@catonthecouchproductions.com>, Ryan Coughlin <glanceatx@gmail.com>' . "\r\n";
	$headers .= 'From: COTC Notifier <clientmail@cotcintranet.com>' . "\r\n";
	mail($to,$subject,$message,$headers);
	
	if(!mail($to,$subject,$message,$headers)){
		echo "Email not sent";
	}else{
		echo "Email sent";
	}
?>
